package com.nhim.cms.web;

import java.io.IOException;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

import com.nhim.cms.cache.management.CacheDataLoader;


/**
 * Application object for your web application. If you want to run this application without deploying, run the Start class.
 * 
 * @see com.nhim.cms.web.Start#main(String[])
 */
public class NhimApplication extends WebApplication
{    

	/**
	 * @see org.apache.wicket.Application#getHomePage()
	 */
	@Override
	public Class<Dispatcher> getHomePage()
	{
		return Dispatcher.class;
	}
	 

	/**
	 * @see org.apache.wicket.Application#init()
	 */
	@Override
	public void init()
	{
		super.init();
		
		getComponentInstantiationListeners().add(new SpringComponentInjector(this));
		try {
			 CacheDataLoader.getInstance().createCache("infinispan-cf.xml");
		} catch (IOException e) {
			e.printStackTrace();
		}
		mountPage("/",Dispatcher.class);
		 // Hello World as a Static Page with XSLT layout
       
	
	}
	
}
